import request from '@/axios'

//获取安装的服务
export const listAppServerApi = (data) => {
  return request.post({ url: '/dbms-server/base/appserver/list', data })
}

//获取所有安装的服务
export const listAppServerAllApi = () => {
  return request.get({ url: '/dbms-server/base/appserver/listAll' })
}

//获取所有微服务
export const listAppApi = () => {
  return request.get({ url: '/dbms-server/base/app/list' })
}

export const restartAppServerApi = (ip: string, appName: string, id: string) => {
  return request.post({ url: '/dbms-server/base/appserver/restart', data: { ip, appName, id } })
}

export const startAppServerApi = (ip: string, appName: string, id: string) => {
  return request.post({ url: '/dbms-server/base/appserver/start', data: { ip, appName, id } })
}

export const stopAppServerApi = (ip: string, appName: string, id: string) => {
  return request.post({ url: '/dbms-server/base/appserver/stop', data: { ip, appName, id } })
}
